package com.cloud.util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 * @author Henry.Song
 * @version 2020/12/18
 * @description
 */
public class JsonUtil {

    public static String toString(Object object) {
        return JSON.toJSONString(object);
    }

    public static void testAlgotithmResult() {
        String str = "{'code':100, msg:'测试成功', 'info':{'zone':'xyyhf', 'count':32}}";
        JSONObject jsonObject = JSON.parseObject(str);
        System.out.println("jsonObject:" + JsonUtil.toString(jsonObject));
    }

    public static void main(String[] args) {
        testAlgotithmResult();
    }
}
